<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>2014年到2050年哪年一月一日是星期日</title>
</head>

<body>
  <script>
    let Y = new Date().getFullYear()
    let m = new Date().getMonth()
    let age = ['日', '一', '二', '三', '四', '五', '六']
    for (var ages = 2014; ages <= 2050; ages++) {
      let time = new Date(Y, m)
      if (time.getDay() == 0) {
        console.log(Y, age[time.getDay()])
      }
      Y++
    }
  </script>
</body>

</html>